//
//  NSArray+XHHAddition.m
//  XHH_ZFB
//
//  Created by xiaohuihui on 9/15/16.
//  Copyright © 2016 xiaohuihui. All rights reserved.
//

#import "NSArray+XHHAddition.h"
#import "NSObject+XHHAddition.h"

@implementation NSArray (XHHAddition)
+ (NSArray *)XHH_objectWithPlistName:(NSString *)plistName clsName:(NSString *)clsName {
    NSURL *url = [[NSBundle mainBundle] URLForResource:plistName withExtension:nil];
    NSArray *list = [NSArray arrayWithContentsOfURL:url];
    NSMutableArray *arrM = [NSMutableArray array];
    //获取模型对象
    Class cls = NSClassFromString(clsName);
    for (NSDictionary *dict in list) {
        [arrM addObject:[cls XHH_objectWithDict:dict]];
    }
    return arrM;
}
@end
